package org.imlinker.setting;

import java.io.File;

/**
 * 用户的帐号。
 * 
 */
public class Settings extends Object {

	public Settings(String path, String userWithResource) {

		String user = userWithResource.substring(0, userWithResource
				.indexOf("/"));
		user = user.replaceAll("@", "at");
		this.path = path + File.separator + "config" + File.separator + user
				+ ".xml";

		file = new SettingFile("userSetting", this.path);

		openFirst = Boolean.parseBoolean(file.getValue("openfirst"));
	}

	public void save() {
		file.setValue("openfirst", Boolean.toString(openFirst));

		file.save();
	}

	public boolean openFirst() {
		return openFirst;
	}

	public void setOpenFirst(boolean b) {
		openFirst = b;
	}

	private String path;

	private boolean openFirst;

	private SettingFile file;

}
